home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-03 | 6.6 KB | 209 lines | [TEXT/MPS ] |
- //----------------------------------------------------------------------------------------
- // UContainerDocument.cp
- // Copyright © 1996 by Apple Computer, Inc. All rights reserved.
- //----------------------------------------------------------------------------------------
-
- #ifndef __UContainerDocument__
- #include "UContainerDocument.h"
- #endif
-
-
- #ifndef __UODPARTVIEW__
- #include "UODPartView.h"
- #endif
-
- #ifndef __UCONTAINER__
- #include "UContainer.h"
- #endif
-
- // MacApp
-
- #ifndef __UMACAPPGLOBALS__
- #include "UMacAppGlobals.h"
- #endif
-
- #ifndef __UMENUMGR__
- #include "UMenuMgr.h"
- #endif
-
- #ifndef __UPRINTING__
- #include "UPrinting.h"
- #endif
-
- #ifndef __UVIEWSERVER__
- #include "UViewServer.h"
- #endif
-
- #ifndef __UWINDOW__
- #include "UWindow.h"
- #endif
-
- //----------------------------------------------------------------------------------------
- // Constants:
- //----------------------------------------------------------------------------------------
- // Static initialization
-
- const ResNumber kContainerWindowID = kDefaultWindowID;
-
- //========================================================================================
- // CLASS TContainerDocument
- //========================================================================================
- #undef Inherited
- #define Inherited TFileBasedDocument
-
- #pragma segment AOpen
- MA_DEFINE_CLASS_M1(TContainerDocument, Inherited);
-
- //----------------------------------------------------------------------------------------
- // TContainerDocument constructor
- //----------------------------------------------------------------------------------------
- #pragma segment AOpen
-
- TContainerDocument::TContainerDocument()
- :fODPartView(NULL)
- {
- } // TContainerDocument::TContainerDocument
-
- //----------------------------------------------------------------------------------------
- // TContainerDocument::IContainerDocument:
- //----------------------------------------------------------------------------------------
- #pragma segment AOpen
-
- void TContainerDocument::IContainerDocument(TFile* itsFile,
- OSType itsCreator)
- {
- this->IFileBasedDocument(itsFile,itsCreator);
- } // TContainerDocument::IContainerDocument
-
- //----------------------------------------------------------------------------------------
- // TContainerDocument destructor
- //----------------------------------------------------------------------------------------
- #pragma segment AClose
-
- TContainerDocument::~TContainerDocument()
- {
- }
-
- //----------------------------------------------------------------------------------------
- // TContainerDocument::FreeData:
- //----------------------------------------------------------------------------------------
- #pragma segment AClose
-
- void TContainerDocument::FreeData() // Override
- {
- Inherited::FreeData();
- } // TContainerDocument::FreeData
-
- //----------------------------------------------------------------------------------------
- // TContainerDocument::DoInitialState:
- //----------------------------------------------------------------------------------------
- #pragma segment AOpen
-
- void TContainerDocument::DoInitialState() // Override
- {
- Inherited::DoInitialState();
- } // TContainerDocument::DoInitialState
-
- //----------------------------------------------------------------------------------------
- // TContainerDocument::DoMakeViews:
- //----------------------------------------------------------------------------------------
- #pragma segment AOpen
-
- void TContainerDocument::DoMakeViews(Boolean /*forPrinting*/) // Override
- {
- TWindow* aWindow = NULL;
-
-
- FailNIL(aWindow = gViewServer->NewTemplateWindow(kContainerWindowID, this));
-
- fODPartView = (TODPartView*) (aWindow->FindSubView('odPT'));
- fFrameRadioButton = (TRadio*) (aWindow->FindSubView('adFR'));
- fViewRadioButton = (TRadio*) (aWindow->FindSubView('adVW'));
-
-
- #if qContainer
- if (gContainerLib && fContainerDocument)
- {
- fRootWindowRef = aWindow->fWMgrWindow;
- CARegisterRootWindow(fRootWindowRef, fContainerDocument);
- FailOSErr(CAError());
- }
- #endif
- } // TContainerDocument::DoMakeViews
-
- //----------------------------------------------------------------------------------------
- // TContainerDocument::CloseWindow:
- //----------------------------------------------------------------------------------------
- #pragma segment MAClose
-
- void TContainerDocument::CloseWindow(TWindow* aWindow) // override
- {
- #if qContainer
- if (aWindow->fWMgrWindow == fRootWindowRef)
- {
- CAUnregisterWindow(fRootWindowRef);
- fRootWindowRef = NULL;
- }
- #endif
- Inherited::CloseWindow(aWindow);
- }
-
- //----------------------------------------------------------------------------------------
- // TContainerDocument::DoNeedDiskSpace:
- //----------------------------------------------------------------------------------------
- #pragma segment AWriteFile
-
- void TContainerDocument::DoNeedDiskSpace(TFile* itsFile,
- long& dataForkBytes,
- long& rsrcForkBytes) // Override
- {
- Inherited::DoNeedDiskSpace(itsFile, dataForkBytes, rsrcForkBytes);
- } // TContainerDocument::DoNeedDiskSpace
-
- //----------------------------------------------------------------------------------------
- // TContainerDocument::DoMenuCommand:
- //----------------------------------------------------------------------------------------
- #pragma segment ASelCommand
-
- void TContainerDocument::DoMenuCommand(CommandNumber aCommandNumber) // Override
- {
- Inherited::DoMenuCommand(aCommandNumber);
- } // TContainerDocument::DoMenuCommand
-
- //----------------------------------------------------------------------------------------
- // TContainerDocument::DoRead:
- //----------------------------------------------------------------------------------------
- #pragma segment AReadFile
-
- void TContainerDocument::DoRead(TFile* aFile,
- Boolean forPrinting) // Override
- {
- Inherited::DoRead(aFile,forPrinting);
- } // TContainerDocument::DoRead
-
- //----------------------------------------------------------------------------------------
- // TContainerDocument::DoSetupMenus:
- //----------------------------------------------------------------------------------------
- #pragma segment ARes
-
- void TContainerDocument::DoSetupMenus() // Override
- {
- Inherited::DoSetupMenus();
- } // TContainerDocument::DoSetupMenus
-
- //----------------------------------------------------------------------------------------
- // TContainerDocument::DoWrite:
- //----------------------------------------------------------------------------------------
- #pragma segment AWriteFile
-
- void TContainerDocument::DoWrite(TFile* aFile,
- Boolean makingCopy) // Override
- {
- Inherited::DoWrite(aFile,makingCopy);
- } // TContainerDocument::DoWrite
-
- //----------------------------------------------------------------------------------------
- // End of UContainerDocument.cp
-
- #pragma segment Inline
-